DumpNetworkSetup dumps the entire contents of the Network Setup database to a text file. The purpose of this sample is twofold. Firstly, it shows a simple use of the Network Setup API. Secondly, it is a useful tool for debugging other Network Setup code because it allows you to see the affect your code had on the database. I used DumpNetworkSetup extensively while developing the MoreNetworkSetup sample.
DumpNetworkSetup requires the Network Setup library, which is available in Mac OS 8.5 and above.
Packing List
The sample contains the following items:
• DumpNetworkSetup.mcp — A project file for the sample.
• DumpNetworkSetup-PPC — A compiled version of the above.
• DumpNetworkSetup.c — Source code to the sample.
• MoreIsBetter — A folder containing the parts of MoreIsBetter that are required by this sample.
• Network Setup SDK Bits — A folder containing some pre-release Network Setup interfaces and libraries.
Using the Sample
To use the sample, simply double-click it and choose a place to save the report. DumpNetworkSetup will create a text file description of the Network Setup database.
Building the Sample
The sample was built using the CodeWarrior Pro 2 C compiler,. You should be able to just open the project, select the “PPC” target, and choose Make from the Project menu. This will build DumpNetworkSetup-PPC.
Caveats
DumpNetworkSetup only compiles for PowerPC because the Network Setup API is only exported to PowerPC clients.
DumpNetworkSetup includes formatted output for a number of important network preferences. However, some preferences are still displayed only in hex.
Credits and Version History
If you find any problems with this sample, mail <DTS@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.